package com.fs.jzzn.pojo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 代办任务
 * @author TiddlerCJ
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Task {
	private String pId;
	private String pRoad;
	private String  nodeName;
	@JSONField (format="yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	private String pNo;
	private String contractNo;
	
	public static  List<Task> getList(List<Object> list){
		List<Task> tasks = new ArrayList<Task>();
		for(Object item:list){
			if(item instanceof Object[]){
				Object[] s = (Object[]) item;
				Task t = new Task();
				t.setPId(s[0].toString());
				t.setPRoad(s[1]!=null? s[1].toString():"");
				t.setNodeName(s[2].toString());
				t.setCreateTime((Date) (s[3]!=null?s[3]: ""));
				t.setPNo(s[4]!=null? s[4].toString():"");
				tasks.add(t);
			}
		}
		return tasks;
	}
}
